package com.personalsystem.tool;

import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;

public class CreateDbTable {
	
	public static void main(String[] args) {
		Configuration configuration = new AnnotationConfiguration();
        configuration.configure();
        SchemaExport export = new SchemaExport(configuration);
        export.execute(true, true, false, true);
//        ServiceRegistry sr = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); 
//      SessionFactory factory=configuration.buildSessionFactory(sr);
//        Session session = factory.openSession();
// //       Session session = factory.getCurrentSession();
//        session.beginTransaction();
//        Person person=new Person();
//        person.setName("xieyaxiong");
//        session.save(person);
//        session.getTransaction().commit();
//        session.close();
	}

}
